﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PMS.Data.DbUtils.DataMapping;
using PMS.Data.Entities.NaviMenus;

namespace PMS.Data.EntityMap.NaviMenus
{
    /// <summary>
    /// Represents a NaviMenuGroup mapping configuration
    /// </summary>
    public partial class NaviMenuGroupMap : PMSEntityTypeConfiguration<NaviMenuGroup>
    {
        #region Methods

        /// <summary>
        /// Configures the entity
        /// </summary>
        /// <param name="builder">The builder to be used to configure the entity</param>
        public override void Configure(EntityTypeBuilder<NaviMenuGroup> builder)
        {
            builder.ToTable("bus_navimenugroup");
            builder.HasKey(group => group.Id);

            builder.Property(group => group.GroupName).HasMaxLength(128).IsRequired();
            builder.Property(group => group.DisplayName).HasMaxLength(128).IsRequired();
            builder.Property(group => group.DisplayOrder).IsRequired();
            builder.Property(group => group.IsActive).IsRequired();
            builder.Property(group => group.CreatedOnTimeUtc).IsRequired();
            builder.Property(group => group.UpdatedOnTimeUtc).IsRequired();

            base.Configure(builder);
        }

        #endregion
    }
}
